<?php if(isset($offer_script)){ ?>
<script>
    $(function(){
        if($(":radio[name='offer_status']:checked").val()==1) $('#offer_group').fadeIn();
        else $('#offer_group').fadeOut();
        $(":radio[name='offer_status']").click(function(){
            if($(this).val()==1) $('#offer_group').fadeIn();
            else $('#offer_group').fadeOut();
        });
    });
    $("#offer_num").keyup(function () {
        $(this).val($(this).val().replace(/[^0-9]/g, ''));
    }).bind("paste", function () {
        $(this).val($(this).val().replace(/[^0-9]/g, ''));
    }).css("ime-mode", "disabled").blur(function() {
        $(this).val($(this).val().replace(/[^0-9]/g, ''));
    });
    var jforum_list = Array();
    <?php foreach($forumlist as $__forum){ ?>
        jforum_list["<?php echo $__forum['fid'];?>"]="<?php echo $__forum['allowOffer'];?>";
    <?php }?>
    jfid.on('change',function(){change_div_offer();});
    change_div_offer();
    function change_div_offer()
    {
        var fid = jfid.val();
        var fid_now = jforum_list[fid];
        if(fid_now=='1') $("#tt_offer").fadeIn();
        else {$("#tt_offer").fadeOut();$("#offer_num").val('');}
    }
</script>
<?php }?>